<template>
  <form ref="form">
    <span>用户名</span>
    <input type="text" name="username" v-model="formdata.username" />
    <br /><br />
    <span>密码&nbsp;&nbsp;&nbsp;</span>
    <input type="text" name="password" v-model="formdata.password" />
    <br /><br />
  </form>
</template>

<script>
export default {
  data() {
    return {
      formdata: {
        username: '',
        password: '',
      },
    }
  },
  methods: {
    isdata() {
      console.log(
        `用户名:${this.formdata.username}+密码:${this.formdata.password}`
      )
      this.formdata = {
        username: '',
        password: '',
      }
    },
  },
}
</script>

<style scoped></style>
